package com.github.easyms.common.constant;

/**
 * @author Leo.Liao
 * 系统业务状态码
 * @date 2020-04-08 23:41:59
 */
public enum EasymsServiceStatus {

    /**
     * 成功
     */
    OK(200,"OK"),

    /**
     * 失败
     */
    ERROR(400 , "operationFailed"),

    /**
     * 访问限制
     */
    ACCESS_DENIED(401,"accessDenied"),

    /**
     * 程序错误
     */
    INTERNAL_ERR(500,"internalErr"),

    /**
     * 无效的参数
     */
    INVALID_PARAM(40001,"invalidParam"),

    /**
     * 对象不存在
     */
    NOT_EXIST(40002,"objectNotExist"),

    /**
     * 密码重复
     */
    DUPLICATE_PWD(40003,"duplicatePassword"),
    /**
     * 用户未分组
     */
    NO_ROLES(40004,"noRoles"),
    /**
     * 数据状态错误
     */
    ERR_STATUS(40006,"errStatus"),

    /**
     * 密码错误
     */
        ERR_PASSWORD(40008,"errPassword"),

    /**
     * 操作频繁
     */
    UPD_PWD_FREQUENTLY(40011,"operationFrequently"),

    /**
     * 默认用户
     */
    DEFAULT_USER(40012,"defaultUser"),

    /**
     * 默认菜单
     */
    DEFAULT_MENU(40013,"defaultMenu"),

    /**
     * 超级管理用户组
     */
    DEFAULT_ROLE(40014,"defaultRole"),

    /**
     * 存在关联数据
     */
    ASSOCIATIONS(40015,"associations"),

    /**
     * 账号被锁定
     */
    ACCOUNT_LOCKED(40016,"accountLocked"),

    /**
     * 登陆失败
     */
    LOGIN_FAILED(40017,"loginFailed"),

    /**
     * 账号不存在
     */
    ACCOUNT_NOT_EXIST(40019,"accountNotExist"),

    /**
     * 对象已存在
     */
    ALREADY_EXISTS(40021,"objectAlreadyExists");

    private final Integer code;
    private final String msgCode;

    EasymsServiceStatus(int code, String msgCode) {
        this.code = code;
        this.msgCode = msgCode;
    }

    public int code() {
        return this.code;
    }

    public String getMsgCode() {
        return this.msgCode;
    }

}
